package com.zhiyou100.crm.service.impl;

import com.zhiyou100.crm.dao.MessageDao;
import com.zhiyou100.crm.service.MessageService;
import com.zhiyou100.crm.pojo.Message;
import com.zhiyou100.crm.util.S_session;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.IOException;
import java.util.List;
@Service("messageServiceImpl")
public class MessageServiceImpl implements MessageService {
//    MessageDao messageDao=new MesageDaoImpl();
    @Autowired
    private MessageDao messageDao;
    @Override
    public List<Message> queryMessage() throws IOException {
        List<Message> messages =messageDao.queryMessage();
        return  messages;
    }

    @Override
    public List<Message> queryByr(Message message) throws IOException {
        List<Message> messages =messageDao.queryByr(message);
        return  messages;
    }
    @Override
    public List<Message> queryBys(Message message) throws IOException {
        List<Message> messages =messageDao.queryBys(message);
        return  messages;
    }

    @Override
    public int delete(int id) throws IOException {
        int a = messageDao.delete(id);
        return a;
    }
    @Override
    public int remove(int id) throws IOException {
        int a = messageDao.remove(id);
        return a;
    }

    @Override
    public int update(Message message) throws IOException {
        int a = messageDao.update(message);
        return a;
    }

    @Override
    public int insert(Message message) throws IOException {
        int a = messageDao.insert(message);
        return a;
    }

    @Override
    public int insert1(Message message) throws IOException {
        int a= messageDao.insert1(message);
        return a;
    }
}
